package com.arui.controller;

import com.arui.Result;
import com.arui.dto.AruioUserDTO;
import com.arui.exception.ServiceException;
import com.arui.service.LoginService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description TODO
 * @Date 2024/8/23 14:32
 * @Created by 10574
 */
@RestController
@RequestMapping("auth")
@RequiredArgsConstructor
@Slf4j
public class LoginController {
    private final LoginService loginService;

    @PostMapping("login")
    public Result<String> Login(@RequestBody AruioUserDTO aruioUserDTO) throws ServiceException {
        return Result.data(loginService.login(aruioUserDTO), "登录成功");
    }
}
